package com.example.matchingengine.service.event;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 成交事件
 * 记录订单撮合后的成交信息，用于消息持久化
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TradeEvent implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 买单ID
     */
    private String buyOrderId;

    /**
     * 卖单ID
     */
    private String sellOrderId;

    /**
     * 交易对
     */
    private String symbol;

    /**
     * 成交价格
     */
    private BigDecimal price;

    /**
     * 成交数量
     */
    private BigDecimal quantity;

    /**
     * 成交时间
     */
    private LocalDateTime tradeTime;
}